﻿status = -1;
var itemList = Array(     
Array(1402014, 100, 1, 1), //温度计,概率，数量，发不发喇叭
Array(1302063, 100, 1, 1), //火焰刀
Array(1302106, 100, 1, 1), //燃烧的冰焰刀
Array(1432013, 100, 1, 1), //南瓜枪
Array(1402044, 100, 1, 1), //南瓜灯笼
Array(1002699, 100, 1, 1), //南瓜帽子
Array(1322051, 100, 1, 1), //七夕
Array(1402013, 100, 1, 1), //白日剑
Array(1332053, 100, 1, 1), //烧烤串
Array(1332021, 100, 1, 1), //乌龙茶
Array(1050100, 100, 1, 1), //蓝浴巾
Array(1051098, 100, 1, 1), //红浴巾
Array(1050127, 100, 1, 1), //浴巾
Array(1702199, 800, 1, 1), //彩色雨伞

Array(1032004, 800, 1, 1), //垃圾
Array(1032005, 800, 1, 1), //绿雨伞
Array(1032006, 800, 1, 1), //黑雨伞
Array(1032007, 800, 1, 1), //褐雨伞
Array(1032008, 800, 1, 1), //紫雨伞
Array(1032009, 800, 1, 1), //红雨伞
Array(1032012, 800, 1, 1), //红色鞭子
Array(1032017, 800, 1, 1), //光线鞭子
Array(1032018, 800, 1, 1), //蔓藤鞭子
Array(1032019, 800, 1, 1), //领路灯
Array(1032022, 800, 1, 1), //圣贤短杖
Array(1032023, 800, 1, 1), //圣诞树手杖
Array(1032025, 800, 1, 1), //圣诞树
Array(1032026, 800, 1, 1), //黄色雨伞
Array(1002019, 800, 1, 1), //绿雨伞
Array(1002020, 800, 1, 1), //黑雨伞
Array(1002021, 800, 1, 1), //褐雨伞
Array(1002022, 800, 1, 1), //紫雨伞
Array(1002023, 800, 1, 1), //红雨伞
Array(1002024, 800, 1, 1), //红色鞭子
Array(1002030, 800, 1, 1), //光线鞭子
Array(1002033, 800, 1, 1), //蔓藤鞭子
Array(1002039, 800, 1, 1), //领路灯
Array(1002040, 800, 1, 1), //圣贤短杖
Array(1002085, 800, 1, 1), //圣诞树手杖
Array(1002086, 800, 1, 1), //圣诞树
Array(1002087, 800, 1, 1), //黄色雨伞
Array(1002088, 800, 1, 1), //绿雨伞
Array(1002171, 800, 1, 1), //黑雨伞
Array(1002172, 800, 1, 1), //褐雨伞
Array(1002173, 800, 1, 1), //紫雨伞
Array(1002174, 800, 1, 1), //红雨伞
Array(1002175, 800, 1, 1), //红色鞭子
Array(1002176, 800, 1, 1), //光线鞭子
Array(1002177, 800, 1, 1), //蔓藤鞭子
Array(1002178, 800, 1, 1), //领路灯
Array(1002179, 800, 1, 1), //圣贤短杖
Array(1002180, 800, 1, 1), //圣诞树手杖
Array(1002181, 800, 1, 1), //圣诞树
Array(1002182, 800, 1, 1), //蔓藤鞭子
Array(1002183, 800, 1, 1), //领路灯
Array(1002184, 800, 1, 1), //圣贤短杖
Array(1002214, 800, 1, 1), //圣诞树手杖
Array(1002215, 800, 1, 1), //圣诞树
Array(1002216, 800, 1, 1), //圣诞树手杖
Array(1002217, 800, 1, 1), //圣诞树
Array(1102000, 800, 1, 1), //蔓藤鞭子
Array(1102001, 800, 1, 1), //领路灯
Array(1102002, 800, 1, 1), //圣贤短杖
Array(1102003, 800, 1, 1), //圣诞树手杖
Array(1082121, 800, 1, 1), //圣诞树
Array(1082122, 800, 1, 1), //圣诞树手杖
Array(1082123, 800, 1, 1), //圣诞树
Array(1082125, 800, 1, 1), //圣诞树
Array(1082126, 800, 1, 1), //圣诞树手杖
Array(1082127, 800, 1, 1), //圣诞树
Array(1082128, 800, 1, 1), //圣诞树
Array(1082129, 800, 1, 1), //圣诞树手杖
Array(1082071, 800, 1, 1), //圣诞树
Array(1082072, 800, 1, 1), //圣诞树
Array(1082073, 800, 1, 1), //圣诞树
Array(1082074, 800, 1, 1), //圣诞树

Array(1302018, 800, 1, 1), //垃圾武器
Array(1302019, 800, 1, 1), //圣诞树手杖
Array(1302020, 800, 1, 1), //圣诞树
Array(1302021, 800, 1, 1), //圣诞树
Array(1302022, 800, 1, 1), //圣诞树
Array(1302023, 800, 1, 1), //圣诞树
Array(1302024, 800, 1, 1), //圣诞树
Array(1302025, 800, 1, 1), //圣诞树手杖
Array(1302026, 800, 1, 1), //圣诞树
Array(1302027, 800, 1, 1), //圣诞树
Array(1302028, 800, 1, 1), //圣诞树
Array(1302029, 800, 1, 1), //圣诞树
Array(1302030, 800, 1, 1), //圣诞树
Array(1302031, 800, 1, 1), //圣诞树手杖
Array(1302032, 800, 1, 1), //圣诞树
Array(1302035, 800, 1, 1), //圣诞树
Array(1302036, 800, 1, 1), //圣诞树
Array(1302042, 800, 1, 1), //圣诞树手杖
Array(1302043, 800, 1, 1), //圣诞树
Array(1302044, 800, 1, 1), //圣诞树
Array(1302045, 800, 1, 1), //圣诞树
Array(1302046, 800, 1, 1), //圣诞树
Array(1302047, 800, 1, 1), //圣诞树
Array(1302049, 800, 1, 1), //圣诞树手杖
Array(1302056, 800, 1, 1), //圣诞树
Array(1302058, 800, 1, 1), //圣诞树
Array(1302059, 800, 1, 1), //圣诞树
Array(1302060, 800, 1, 1), //战士
Array(1332000, 800, 1, 1), //圣诞树
Array(1332001, 800, 1, 1), //圣诞树手杖
Array(1332002, 800, 1, 1), //圣诞树
Array(1332003, 800, 1, 1), //圣诞树
Array(1332004, 800, 1, 1), //圣诞树
Array(1332005, 800, 1, 1), //圣诞树
Array(1332006, 800, 1, 1), //圣诞树
Array(1332007, 800, 1, 1), //圣诞树手杖
Array(1332008, 800, 1, 1), //圣诞树
Array(1332025, 800, 1, 1), //圣诞树
Array(1332026, 800, 1, 1), //圣诞树
Array(1332027, 800, 1, 1), //圣诞树
Array(1332028, 800, 1, 1), //圣诞树
Array(1332029, 800, 1, 1), //圣诞树
Array(1332030, 800, 1, 1), //圣诞树
Array(1332031, 800, 1, 1), //圣诞树
Array(1332032, 800, 1, 1), //圣诞树
Array(1332033, 800, 1, 1), //圣诞树
Array(1332034, 800, 1, 1), //圣诞树
Array(1332035, 800, 1, 1), //圣诞树
Array(1332036, 800, 1, 1), //圣诞树
Array(1332037, 800, 1, 1), //圣诞树
Array(1332038, 800, 1, 1), //圣诞树
Array(1332039, 800, 1, 1), //飞侠
Array(1372010, 800, 1, 1), //圣诞树
Array(1372011, 800, 1, 1), //圣诞树手杖
Array(1372012, 800, 1, 1), //圣诞树
Array(1372013, 800, 1, 1), //圣诞树
Array(1372014, 800, 1, 1), //圣诞树
Array(1372015, 800, 1, 1), //圣诞树
Array(1372016, 800, 1, 1), //圣诞树
Array(1372017, 800, 1, 1), //圣诞树手杖
Array(1372018, 800, 1, 1), //圣诞树
Array(1372019, 800, 1, 1), //圣诞树
Array(1372020, 800, 1, 1), //圣诞树
Array(1372021, 800, 1, 1), //圣诞树
Array(1382006, 800, 1, 1), //圣诞树
Array(1382007, 800, 1, 1), //圣诞树
Array(1382008, 800, 1, 1), //圣诞树
Array(1382009, 800, 1, 1), //圣诞树
Array(1382010, 800, 1, 1), //圣诞树
Array(1382011, 800, 1, 1), //圣诞树
Array(1382012, 800, 1, 1), //圣诞树
Array(1382013, 800, 1, 1), //圣诞树
Array(1382014, 800, 1, 1), //圣诞树
Array(1382015, 800, 1, 1), //圣诞树
Array(1382016, 800, 1, 1), //法师
Array(1452005, 800, 1, 1), //圣诞树
Array(1452006, 800, 1, 1), //圣诞树手杖
Array(1452007, 800, 1, 1), //圣诞树
Array(1452008, 800, 1, 1), //圣诞树
Array(1452009, 800, 1, 1), //圣诞树
Array(1452010, 800, 1, 1), //圣诞树
Array(1452011, 800, 1, 1), //圣诞树
Array(1452012, 800, 1, 1), //圣诞树手杖
Array(1452013, 800, 1, 1), //圣诞树
Array(1452014, 800, 1, 1), //圣诞树
Array(1452015, 800, 1, 1), //圣诞树
Array(1452016, 800, 1, 1), //圣诞树
Array(1452017, 800, 1, 1), //圣诞树
Array(1452018, 800, 1, 1), //圣诞树
Array(1452019, 800, 1, 1), //圣诞树
Array(1452044, 800, 1, 1), //圣诞树
Array(1462000, 800, 1, 1), //圣诞树
Array(1462001, 800, 1, 1), //圣诞树
Array(1462002, 800, 1, 1), //圣诞树
Array(1462003, 800, 1, 1), //圣诞树
Array(1462004, 800, 1, 1), //圣诞树
Array(1462005, 800, 1, 1), //圣诞树
Array(1462006, 800, 1, 1), //圣诞树
Array(1462007, 800, 1, 1), //圣诞树
Array(1462008, 800, 1, 1), //弓手

Array(1302016, 800, 1, 1), //黄色雨伞
Array(1302027, 800, 1, 1), //绿雨伞
Array(1302026, 800, 1, 1), //黑雨伞
Array(1302029, 800, 1, 1), //褐雨伞
Array(1302028, 800, 1, 1), //紫雨伞
Array(1302025, 800, 1, 1), //红雨伞
Array(1302013, 800, 1, 1), //红色鞭子
Array(1302049, 800, 1, 1), //光线鞭子
Array(1302061, 800, 1, 1), //蔓藤鞭子
Array(1372017, 800, 1, 1), //领路灯
Array(1372031, 800, 1, 1), //圣贤短杖
Array(1432046, 800, 1, 1), //圣诞树手杖
Array(1332032, 800, 1, 1), //圣诞树

Array(1402029, 800, 1, 1), //鬼刺狼牙棒
Array(1382037, 800, 1, 1), //偃月之杖
Array(1332030, 800, 1, 1), //团扇
Array(1432017, 800, 1, 1), //滑雪板
Array(1432018, 800, 1, 1), //滑雪板
Array(1432015, 800, 1, 1), //滑雪板
Array(1432016, 800, 1, 1), //滑雪板
Array(1442046, 100, 1, 1), //滑雪板
Array(1032028, 800, 1, 1), //黑水晶耳环
Array(1032027, 800, 1, 1), //黄水晶耳环
Array(1032026, 100, 1, 1), //红水晶耳环
Array(1072239, 800, 1, 1), //黄色钉鞋
Array(1072238, 800, 1, 1), //紫色钉鞋
Array(1102085, 800, 1, 1), //黄色盖亚
Array(1102084, 100, 1, 1), //紫色盖亚
Array(1102086, 100, 1, 1), //粉色盖亚
Array(1462020, 100, 1, 1), //烈焰之弩
Array(1382013, 100, 1, 1), //烈焰之杖
Array(1332028, 100, 1, 1), //烈焰之刃
Array(1302032, 100, 1, 1), //烈焰之剑
Array(1092050, 100, 1, 1), //冷艳剑盾
Array(1092049, 0, 1, 1), //热情剑盾
Array(1002939, 10, 1, 1), //安全帽
Array(1432037, 10, 1, 1), //枫叶大将棋
Array(1082150, 800, 1, 1), //工地手套
Array(1082145, 800, 1, 1), //工地手套
Array(1082146, 800, 1, 1), //工地手套
Array(1082147, 800, 1, 1), //工地手套
Array(1082148, 800, 1, 1), //工地手套
Array(1082149, 100, 1, 1), //褐色工地

Array(1122133, 10, 1, 1), //封印的冒险之心
Array(1122134, 10, 1, 1), //封印的冒险之心
Array(1122135, 10, 1, 1), //封印的冒险之心
Array(1122136, 10, 1, 1), //封印的冒险之心

Array(1122029, 1, 1, 1), //苏醒的冒险之心
Array(1122030, 1, 1, 1), //苏醒的冒险之心
Array(1122031, 1, 1, 1), //苏醒的冒险之心
Array(1122032, 1, 1, 1), //苏醒的冒险之心

Array(1302021, 800, 1, 1), //橡皮榔头
Array(1302024, 800, 1, 1), //废报纸卷
Array(1002418, 800, 1, 1), //废报纸头盔
Array(1302019, 800, 1, 1), //无名剑
Array(1312013, 800, 1, 1), //判官笔
Array(1312014, 800, 1, 1), //阎王笔
Array(1322021, 100, 1, 1), //黑游泳圈
Array(1322023, 800, 1, 1), //蓝花纹游泳圈
Array(1322022, 800, 1, 1), //红花纹游泳圈
Array(1322024, 800, 1, 1), //紫游泳圈
Array(1322025, 800, 1, 1), //救命游泳圈
Array(1322026, 800, 1, 1), //彩虹游泳圈
Array(1322012, 800, 1, 1), //红色砖头
Array(1322031, 800, 1, 1), //葵花宝典
Array(1322027, 100, 1, 1), //平底锅

Array(3010898, 800, 1, 1), //迷你神兽椅子
Array(3010895, 800, 1, 1), //阿卡伊勒童话
Array(3010492, 800, 1, 1), //首脑椅子
Array(3010494, 800, 1, 1), //TV椅子
Array(3010876, 800, 1, 1), //冒险岛行星椅子
Array(3010879, 800, 1, 1), //繁星椅子
Array(3010465, 800, 1, 1), //可爱音符椅子
Array(3010460, 800, 1, 1), //爆竹椅子
Array(3010456, 800, 1, 1), //杜鹃花椅子
Array(3010449, 800, 1, 1), //痊愈10周椅子
Array(3010440, 800, 1, 1), //寻找故乡的月妙椅子

Array(3010448, 800, 1, 1), //泡泡浴椅子
Array(3010435, 800, 1, 1), //千年狐椅子
Array(3010430, 800, 1, 1), //蓝色龙椅子
Array(3010429, 800, 1, 1), //红色龙椅子
Array(3010423, 800, 1, 1), //北极熊椅子
Array(3010099, 800, 1, 1), //鬼娃娃椅子
Array(3010085, 800, 1, 1), //大熊猫椅子
Array(3010078, 800, 1, 1), //猫头鹰椅子
Array(3010077, 800, 1, 1), //肥猫猫椅子
Array(3010079, 800, 1, 1), //露水椅子
Array(3010068, 800, 1, 1), //兔子纪念版椅子

Array(3010110, 800, 1, 1), //舒适大白熊椅子
Array(3010117, 800, 1, 1), //魔法书椅子
Array(3010100, 800, 1, 1), //财神椅子
Array(3010814, 800, 1, 1), //粉丝抱枕椅子
Array(3010375, 800, 1, 1), //奥妙的超级药水椅子
Array(3010377, 800, 1, 1), //新鲜的蓝色药水椅子
Array(3010376, 800, 1, 1), //橙色HP药水椅子
Array(3010300, 800, 1, 1), //超级药水椅子
Array(3010302, 800, 1, 1), //闪耀星星之夜椅子
Array(3010374, 800, 1, 1), //云朵洗手间椅子
Array(3010799, 800, 1, 1), //坟墓幽灵椅子

Array(3010797, 800, 1, 1), //新春快乐椅子
Array(3010737, 800, 1, 1), //动物英雄团椅子
Array(3010738, 800, 1, 1), //闪电三人组椅子
Array(3010739, 800, 1, 1), //雪人香波椅子
Array(3010067, 800, 1, 1), //红色设计师椅
Array(3010065, 800, 1, 1), //粉红海滩遮阳椅
Array(3010806, 800, 1, 1), //桃樱芳菲椅
Array(3010664, 800, 1, 1), //进化椅子
Array(3010662, 800, 1, 1), //章鱼鱼缸椅
Array(3010659, 800, 1, 1), //巴士车站椅子

Array(3010209, 800, 1, 1), //香草冰淇淋月饼椅子
Array(3010205, 800, 1, 1), //古老录音机椅子
Array(3010511, 800, 1, 1), //猫咪公园椅子
Array(3014000, 800, 1, 1), //惊人漫画椅子
Array(3010946, 800, 1, 1), //森林伙伴野营椅子
Array(3010402, 800, 1, 1), //生日派对椅
Array(3010966, 800, 1, 1), //幽灵船椅子
Array(3012025, 5, 1, 1), //小鸡弹簧床椅子
Array(3012024, 5, 1, 1), //沙滩排球椅子
Array(3012019, 5, 1, 1), //爱琴海椅子
Array(3012020, 5, 1, 1), //紫藤花吊篮椅
Array(3010690, 5, 1, 1), //滑浪飞船椅子
Array(3010681, 5, 1, 1), //特大西瓜椅子
Array(3010670, 5, 1, 1), //绝对指环椅子
Array(3010660, 5, 1, 1), //梦幻公主城堡椅子
Array(3010658, 5, 1, 1), //布莱克缤椅子
Array(3010592, 5, 1, 1), //巨大企鹅王椅子
Array(3010520, 5, 1, 1), //巨大白雪人椅子
Array(3010519, 5, 1, 1), //巨无霸品克缤
Array(3010070, 5, 1, 1), //巨无霸国际巨星
Array(3015051, 5, 1, 1), //巨无霸年夜饭
Array(3010788, 5, 1, 1), //巨无霸品克缤

Array(3015304, 1, 1, 1), //大水车
Array(1902055, 0, 1, 1), //海盗船
Array(1912048, 0, 1, 1), //海盗船鞍子 
Array(1902063, 1, 1, 1), //御剑飞行
Array(1912056, 1, 1, 1), //御剑飞行 

Array(1402037, 5, 1, 1), //龙背
Array(1372040, 10, 1, 1), //剧毒
Array(1372041, 10, 1, 1), //寒冰之杖
Array(1372042, 10, 1, 1), //狂雷之杖
Array(1372039, 10, 1, 1), //爆炎之杖
Array(1372042, 50, 1, 1), //雷灵珠短杖
Array(1372042, 50, 1, 1), //火灵珠短杖
Array(1372042, 50, 1, 1), //冰灵珠短杖
Array(1372042, 50, 1, 1), //毒灵珠短杖

Array(1382045, 10, 1, 1), //火灵珠长杖
Array(1382047, 10, 1, 1), //冰灵珠长杖
Array(1382046, 10, 1, 1), //毒灵珠长杖
Array(1382048, 10, 1, 1) //雷灵珠长杖
);

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == 1) {
        status++;
    } else {
        if (status == 0) {
            cm.sendOk("#v4310003#你有吗？？");
            cm.dispose();
        }
        status--;
    }
    if (status == 0) {
        if (cm.haveItem(4310003, 1)) {
			var itemt = "";
			//for (var i = 0; i < itemList.length; i++) {
			//itemt += "#v"+itemList[i][0]+"#";
			//}
			itemt += "\r\n\r\n#v4310003#你有这个吗？有的话可以抽奖哦！！";
            cm.sendYesNo(itemt);
           // cm.sendYesNo("#v4310003#你想要抽奖吗？？?");
        } else {
            cm.sendOk("#v4310003#你有这个吗？有的话可以抽奖哦！！");
            cm.safeDispose();
        }
    } else if (status == 1) {
        var chance = Math.floor(Math.random() * 800);
        var finalitem = Array();
        for (var i = 0; i < itemList.length; i++) {
            if (itemList[i][1] >= chance) {
                finalitem.push(itemList[i]);
            }
        }
        if (finalitem.length != 0) {
            var item;
            var random = new java.util.Random();
            var finalchance = random.nextInt(finalitem.length);
            var itemId = finalitem[finalchance][0];
            var quantity = finalitem[finalchance][2];
            var notice = finalitem[finalchance][3];
            item = cm.gainGachaponItem(itemId, quantity, "点卷抽奖", notice);
            if (item != -1) {
                cm.gainItem(4310003, -1);
                cm.sendOk("恭喜你获得#b#t" + item + "##k " + quantity + "一个");
            } else {
                cm.sendOk("#v4310003#你想要抽奖吗？？?");
            }
            cm.safeDispose();
        } else {
            cm.sendOk("什么都没抽到 ,返还一个 #v4310003# 给你!.");
            cm.gainItem(4310003, -1);
            cm.gainItem(4310003, 1);
            cm.safeDispose();
        }
    }
}